package com.fates.ucenter.enums;

import com.baomidou.mybatisplus.enums.IEnum;

/**
 * 用戶性別枚举
 * @author TxT-PC
 *
 */
public enum UserSexEnum implements IEnum{
    MAN(1, "男"),
    WOMAN(2, "女");
	
	private Integer value;
	private String desc;
	
	UserSexEnum(final Integer value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc(){
        return this.desc;
    }
    
    public static UserSexEnum getByValue(int value) {
        for (UserSexEnum ruse : UserSexEnum.values()) {
            if (ruse.getValue() == value) {
                return ruse;
            }
        }
        return null;
    }
}
